import Jsr from "../../jsr/Jsr.js"

import RunEntity from "./RunEntity.js"


export default async  function   JsrLoad(name,obj,value,type){

    let res;
   let root= qguan("root")
    let data=root.findData(name+".jsr")

   res= await  data.then(   (data1)=>{
        let jsr =new Jsr();
        jsr.loadData(data1)
        let aopFactory=qguan("aopFactory")
         let code=  jsr.findFileByRegular(name,obj,value);
        if(code){
            let tes1=new TextDecoder();
            let buff=new Uint8Array(code);
             let txt= tes1.decode(buff);
            let resObj=     aopFactory.createCodeObj(name,value,txt)
            return resObj;
        }
    } )


}